import request from '@/utils/request';

let baseURL = '/property-portal/v1/api';

// 设备库项目列表
export const equipmentProjectListApi = params => {
	return request({
		url: `${baseURL}/tDevice/queryProjectDeviceList`,
		method: 'post',
		data: params,
	});
};

// 保养计划项目列表
export const planProjectListApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/queryProjectMaintenanceList`,
		method: 'post',
		data: params,
	});
};

// 保养计划-校色查询
export const planRoleDropApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/queryRoleKeyList`,
		method: 'post',
		data: params,
	});
};

// 设备-新增--------------------------------------------------------------------设备----------------------------------------------------------------------
export const equipmentAddApi = params => {
	return request({
		url: `${baseURL}/tDevice/create`,
		method: 'post',
		data: params,
	});
};

// 设备-更新
export const equipmentUpdateApi = params => {
	return request({
		url: `${baseURL}/tDevice/update`,
		method: 'post',
		data: params,
	});
};

// 设备-详情
export const equipmentInfoApi = params => {
	return request({
		url: `${baseURL}/tDevice/detail/${params}`,
		method: 'get',
	});
};

// 设备-列表
export const equipmentListApi = params => {
	return request({
		url: `${baseURL}/tDevice/queryDeviceList`,
		method: 'post',
		data: params,
	});
};

// 设备-二维码下载
export const equipmentQrCodeDownloadApi = params => {
	return request({
		url: `${baseURL}/tDevice/download`,
		method: 'post',
		data: params,
	});
};

//设备二维码批量下载
export const batchDownloadApi = params => {
	return request({
		url: `${baseURL}/tDevice/downloadZip`,
		method: 'post',
		data: params,
		responseType: 'blob',
	});
};

// 设备-导出
export const equipmentExportApi = data => {
	return request({
		url: `${baseURL}/tDevice/exportDevice`,
		method: 'post',
		data,
		responseType: 'blob',
	});
};

// 设备-导入
export const equipmentImportApi = params => {
	return request({
		url: `${baseURL}/tDevice/importDevice`,
		method: 'post',
		data: params,
	});
};

// 验收标准-新增-----------------------------------------------------------------验收标准-----------------------------------------------------------------
export const standardAddApi = params => {
	return request({
		url: `${baseURL}/acceptanceStandard/create`,
		method: 'post',
		data: params,
	});
};

// 验收标准-更新
export const standardUpdateApi = params => {
	return request({
		url: `${baseURL}/acceptanceStandard/update`,
		method: 'post',
		data: params,
	});
};

// 验收标准-删除
export const standardDeleteApi = params => {
	return request({
		url: `${baseURL}/acceptanceStandard/delete/${params}`,
		method: 'delete',
	});
};

// 验收标准-详情
export const standardInfoApi = params => {
	return request({
		url: `${baseURL}/acceptanceStandard/detail/${params}`,
		method: 'get',
	});
};

// 验收标准-列表
export const standardListApi = params => {
	return request({
		url: `${baseURL}/acceptanceStandard/list`,
		method: 'post',
		data: params,
	});
};

// 保养计划-列表--------------------------------------------------------------保养计划-----------------------------------------------------------------
export const planMaintainListApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/queryMaintenanceList`,
		method: 'post',
		data: params,
	});
};

// 保养计划-新增
export const planMaintainAddApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/create`,
		method: 'post',
		data: params,
	});
};

// 保养计划-更新
export const planMaintainUpdateApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/update`,
		method: 'post',
		data: params,
	});
};

// 保养计划-详情
export const planMaintainInfoApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/detail/${params}`,
		method: 'get',
	});
};

// 保养计划-可选择的设备列表
export const planEquipmentListApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/queryDeviceList`,
		method: 'post',
		data: params,
	});
};

// 保养计划-设备绑定
export const planEquipmentBindApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/maintenanceDeviceBind`,
		method: 'post',
		data: params,
	});
};

// 新增保养计划-选择角色
export const rolePlanListApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/maintenanceRoleDropDown`,
		method: 'post',
		data: params,
	});
};

// 保养计划-标准详情（有是否选中标识）
export const standradChooseListApi = params => {
	return request({
		url: `${baseURL}/maintenanceStandard/queryMaintenanceStandardDetailList`,
		method: 'post',
		data: params,
	});
};

// 巡检计划的计划绑定后调后的回调
export const planBindCbApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/savePlanMaintenanceStatus`,
		method: 'post',
		data: params,
	});
};

// 保养计划-标准-绑定
export const standradBindApi = params => {
	return request({
		url: `${baseURL}/maintenanceStandard/maintenanceStandardDeviceBind`,
		method: 'post',
		data: params,
	});
};

// 保养计划-绑定过的设备点位列表
export const planPointBoundListApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/queryMaintenanceDeviceList`,
		method: 'post',
		data: params,
	});
};

// -------------------------------------------------------------设备保养标准-----------------------------------------------------------------

// 保养标准-列表
export const standardMaintainListApi = params => {
	return request({
		url: `${baseURL}/maintenanceStandard/maintenanceStandardList`,
		method: 'post',
		data: params,
	});
};

// 保养标准-新增
export const standardMaintainAddApi = params => {
	return request({
		url: `${baseURL}/maintenanceStandard/createMaintenanceStandard`,
		method: 'post',
		data: params,
	});
};

// 保养标准-更新
export const standardMaintainUpdateApi = params => {
	return request({
		url: `${baseURL}/maintenanceStandard/updateMaintenanceStandard`,
		method: 'post',
		data: params,
	});
};

// 保养标准-详情
export const standardMaintainInfoApi = params => {
	return request({
		url: `${baseURL}/maintenanceStandard/findMaintenanceStandardView`,
		method: 'post',
		data: params,
	});
};

// 保养标准 配置保存
export const standardMaintainConfigSaveApi = params => {
	return request({
		url: `${baseURL}/maintenanceStandard/saveMaintenanceStandardDetail`,
		method: 'post',
		data: params,
	});
};

// 保养标准 配置详情
export const standardMaintainConfigInfoApi = params => {
	return request({
		url: `${baseURL}/maintenanceStandard/findMaintenanceStandardDetailView`,
		method: 'post',
		data: params,
	});
};
